package xin.nick.sudu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xin.nick.sudu.domain.ContentBody;

/**
 * @author Nick
 * @since 2025/3/5
 */
@RestController
@RequestMapping("/api")
public class PasteController {

    private String tempString;

    @PostMapping("/put")
    public ContentBody put(@RequestBody ContentBody data) {
        tempString = data.getContent();
        return data;
    }

    @GetMapping("/get")
    public ContentBody get() {
        ContentBody data = new ContentBody();
        data.setContent(tempString);
        return data;
    }

}
